package com.ltedu.course.domain.vo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ltedu.common.serializer.LongJsonDeserializer;
import com.ltedu.common.serializer.LongJsonSerializer;
import com.ltedu.common.validate.Create;
import com.ltedu.common.validate.Update;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @className: ChapterVO
 * @auther: Jerry
 * @date: 2020/12/10 10:45
 * @desctiption: TODO
 * @version: 1.0
 */
public class ChapterVO implements Serializable {
    private static final long serialVersionUID = -8223109640068015881L;

    /**
     * 主键
     */
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    @NotNull(groups = Update.class, message = "id不能为空")
    private Long id;

    /**
     * 课程id
     */
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    @NotNull(groups = Create.class, message = "id不能为空")
    @NotNull(groups = Update.class, message = "id不能为空")
    private Long courseId;

    /**
     * 章节标题
     */
    @NotEmpty(groups = Create.class, message = "标题不能为空")
    @NotEmpty(groups = Update.class, message = "标题不能为空")
    private String title;

    /**
     * 状态(1:正常，0:禁用)
     */
    private Integer state;

    /**
     * 排序
     */
    @NotNull(groups = Create.class, message = "排序不能为空")
    @NotNull(groups = Update.class, message = "排序不能为空")
    private Integer sort;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

}
